<?php

/**
 * Json
 *
 * @author edikud
 * @package Json
 * @copyright Copyright (c) 2019 Cola (http://www.mcooo.com)
 * @license GNU General Public License 2.0
 */
class Json
{
    public static function encode($data)
    {
	    return json_encode($data, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE);
    }
    public static function decode($json)
    {
	    $json = trim($json, "\xEF\xBB\xBF");
	    $json = trim($json, "\xFE\xFF");
        return json_decode($json, TRUE);
    }
}

